import GameController from "./control/GameController";
import cjs=createjs;
import LayerController from "./control/LayerController";
import MessageController from "./control/MessageController";
import OptionModel from "./model/OptionModel";
/**
 * 游戏根节点
 */
export default class GameRoot extends cjs.Container {
    //private gameController:GameController;
    private messageController:MessageController;
    constructor(id:string) {
        super();
        const option=new OptionModel()
        option.layer=new LayerController()
        option.message=new MessageController()
        option.root=this
        option.id=id
        const game=new GameController();
        game.init(option)
        game.start()
        this.messageController=option.message
    }
    send(type:string,data?:any):void{
        this.messageController.send(type,data)
    }
}